package com.zp.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

/**
 * create login information entity with properties
 * 
 * @version 1.0
 * 
 * @since 1.0
 * 
 * @author chenlijun08@gmail.com
 * 
 * @date 2014/2/8
 * 
 */
@XmlRootElement
@Entity
@Table(catalog = "zzyyp", name = "tb_login_info")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class LoginInfo implements Serializable {

	private static final long serialVersionUID = 1L;
	private String id;
	private String username;
	private String password;
	private String status;
	private int passErrorCount;
	private String passStatus;
	private Date passUpdateTime;

	@Id
	@GenericGenerator(name = "generator", strategy = "uuid")
	@GeneratedValue(generator = "generator")
	@Column(length = 32, nullable = false, name = "login_user_id", unique = true)
	public String getId() {
		return id;
	}

	public void setId(String userId) {
		this.id = userId;
	}

	@Column(length = 20, nullable = false, name = "login_name", unique = true)
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(length = 32, nullable = false, name = "login_password")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(length = 1, name = "login_status")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "login_pass_error_num")
	public int getPassErrorCount() {
		return passErrorCount;
	}

	public void setPassErrorCount(int passErrorCount) {
		this.passErrorCount = passErrorCount;
	}

	@Column(length = 1, name = "login_pass_status")
	public String getPassStatus() {
		return passStatus;
	}

	public void setPassStatus(String passStatus) {
		this.passStatus = passStatus;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "login_pass_update_time")
	public Date getPassUpdateTime() {
		return passUpdateTime;
	}

	public void setPassUpdateTime(Date passUpdateTime) {
		this.passUpdateTime = passUpdateTime;
	}

}
